<template>
  <div id="app">
    <nav>
      <a href="/teacher">TTT</a> |
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> |
      <router-link to="/teacher">Teacher</router-link> |
      <router-link :to="{path:'/teacher'}">Teacher</router-link> |
      <router-link :to="{name:'teacher'}">Teacher</router-link> |
      <router-link to="/user">User</router-link> |
    </nav>
    <!--  路由加载的内容一定展示在router-view组件中  -->
    <router-view/>
  </div>
</template>

<script>
/* student文件是以default的方式导出的内容，只能使用变量名的方式接收 */
// import stu2 from '@/test/student'
/* teacher文件是直接export多个内容，必须使用解构赋值的方式接收 */
// import { name } from '@/test/teacher'

import { setTime } from '@/test/test2'
import { setTimeAsync } from '@/test/test3'

// import test from '@/test/test'
export default {
  name: 'App',
  created () {
    // console.log(stu2)
    // console.log(name)
    // test.set1(function (s1) {
    //   console.log('set1', s1)
    // }, function (s2) {
    //   console.log('set1', s2)
    // })
    //
    // test.set2().then(res => {
    //   console.log('set2', res)
    // }).catch(e => console.log('set2', e))

    // test.set2().then(res => { console.log(res) }, err => { console.log(err) })

    setTime()
    setTimeAsync()
  }
}
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
